package org.msb.accentis.gui.views;

import org.msb.accentis.data.IDataManagerFactoryListener;
import org.msb.accentis.data.pojo.Payee;

class PayeeTableModel extends BasicTableModel<Payee> implements IDataManagerFactoryListener {

	private static String[] COLUMN_NAMES = { "Name", "Contact", "Phone Number", "Email", "Website" };

	@Override
	public String[] getColumnNames() {
		return COLUMN_NAMES;
	}

	@Override
	public Object getValue(Payee object, int column) {
		switch (column) {
		case 0:
			return object.getName();
		case 1:
			return object.getContact();
		case 2:
			return object.getPhoneNumber();
		case 3:
			return object.getEmailAddress();
		case 4:
			return object.getWebsite();
		}

		return null;
	}

	@Override
	protected String getQueryName() {
		return "Payee.getAllPayees";
	}

	@Override
	protected Class<Payee> getPojoClass() {
		return Payee.class;
	}
}